package com.jr.service.impl;

import com.jr.dao.IProjectInfoDao;
import com.jr.dao.impl.ProjectInfoDaoImpl;
import com.jr.pojo.ProjectInfo;
import com.jr.service.IProjectInfoService;
import com.jr.util.PageHelper;

import java.util.ArrayList;

public class ProjectInfoServiceImpl implements IProjectInfoService {

   private IProjectInfoDao ipd=new ProjectInfoDaoImpl();

    @Override
    public ArrayList<ProjectInfo> queryByStatus(Integer status, PageHelper ph) {
        return ipd.selectByStatus(status,ph);
    }

    @Override
    public int queryDataCount(Integer status) {
        return ipd.selectDataCount(status);
    }

    @Override
    public ProjectInfo queryByPid(Integer pid) {
        ArrayList<ProjectInfo> projectInfos = ipd.selectByPid(pid);
        if(projectInfos.size()>0){
            return projectInfos.get(0);
        }else{
            return null;
        }
    }

    @Override
    public boolean updateProject(ProjectInfo pro) {
        return ipd.updateProject(pro)>0;
    }


}
